#!/usr/bin/python
# -*- coding:UTF-8 -*-
"""
All rights reserved
"""

from google.appengine.ext import db

class User(db.Model):
    userid = db.IntegerProperty()
    email = db.StringProperty(multiline=False)
    nickname = db.StringProperty(multiline=False)
    password = db.StringProperty(multiline=False)
    date = db.DateTimeProperty(auto_now_add=True)
    valid = db.IntegerProperty()

class Session(db.Model):
    sessionkey=db.StringProperty(multiline=False)
    addr=db.StringProperty(multiline=False)
    userid = db.IntegerProperty()
    nickname = db.StringProperty(multiline=False)
    email=db.StringProperty(multiline=False)
    date = db.DateTimeProperty(auto_now_add=True)
    expire=db.BooleanProperty()

class TestPaper(db.Model):
    paperid = db.IntegerProperty()
    ownerid = db.IntegerProperty()
    oweremail = db.StringProperty(multiline=False)
    title = db.StringProperty(multiline=False)
    date = db.DateTimeProperty(auto_now_add=True)
    
class Question(db.Model):
    qid = db.IntegerProperty()
    paperid = db.IntegerProperty()
    quest= db.StringProperty(multiline=True)
    answerid = db.IntegerProperty()
 
class Option(db.Model):
    optionid = db.IntegerProperty()
    qid = db.IntegerProperty()
    content = db.StringProperty(multiline=False)
